package net.sf.midollo.io.printable;

import net.sf.midollo.io.IOUtils;

import java.io.OutputStream;
import java.io.IOException;

public class PrintableOutputStream extends OutputStream {

	protected final OutputStream os;

	public PrintableOutputStream(OutputStream os) {
		if (os == null)
			os = IOUtils.NULL_OUTPUT;
		this.os = os;
	}

	public void write(int b) throws IOException {
		if (b < 32 && b != 13 && b != 10 && b != 9)
			b = '.';
		this.os.write(b);
	}
}
